home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!not-for-mail
- From: Mike Landmeier <PosLogc@primenet.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Q: how to handle currency?
- Date: 29 Jan 1996 16:37:01 -0700
- Organization: PosLogic
- Sender: root@primenet.com
- Message-ID: <310D5A3F.1DF@primenet.com>
- References: <4e93he$ec@sun.cis.smu.edu>
- X-Posted-By: ip101.phx.primenet.com
- X-Mailer: Mozilla 2.0b3 (WinNT; I)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Damon Bowman wrote:
- >
- > Another beginner question:
- >
- > What data type is used for currency when you want "precision as
- > displayed?" When using the float or double data types, you run into
- > the problem of imprecision. In other words, I want to actually round
- > off my numbers when necessary to create real amounts of EXACTLY 47.23,
- > or whatever the case may be.
- >
- > One of my books suggests that there is a method of doing this with
- > integers, but it does not go into any detail.
- >
- > Any assistance is appreciated.
-
-
- Using MFC4.0 you can take advantage of COleCurrency where you
- will get a 64 bit integer with 4 digits of precision. This is
- the same format as used by visual basic.
-
- Mike Landmeier
- PosLogic
-